
$(document).ready(function(){
	var rootPath = getRootPath();
	var potentialUserId = '';
	var phone = '';
	var submitDateFrom = '';
	var submitDateEnd = '';
	var startDateFrom = '';
	var startDateEnd = '';
	var askingPriceStatus = '';
	
	$.ajax({
		method : 'get',
		url : rootPath+'/wechat/api/askingPrice/selectPrice?potentialUserId='+potentialUserId+'&phone='+phone+'&submitDateFrom='+submitDateFrom+'&submitDateEnd='+submitDateEnd+'&startDateFrom='+startDateFrom+'&startDateEnd='+startDateEnd+'&askingPriceStatus='+askingPriceStatus,
		error:function(XMLHttpRequest, ajaxOptions, thrownError){
			alert("连接服务器错误!");
		},
		success : function(resultData){
			
			var wholeHtml = '';
			
			$.each(resultData,function(askingpriceIndex,askingpriceObj){
				
				var askingpriceHtml = '';
				
				var askingPriceStatus = '';
				
				if(askingpriceObj.askingPriceStatus==10011001){
					askingPriceStatus = '已报价';
				}
				else if(askingpriceObj.askingPriceStatus==10011002){
					askingPriceStatus = '受理中';
				}
				else{ 
					askingPriceStatus = '取消';
				}
				var askingPriceId = askingpriceObj.askingPriceId
				
				askingpriceHtml = askingpriceHtml   + '<div class="panel panel-default">'
				  									+ '<a href="askingpriceinfor.html?askingPriceId='+askingPriceId+'" class="list-group-item clearfix">'
				  									+ '<div style="width:70%;float:left">'
				  									+ '<p>'+ askingpriceObj.packageCodeName + '</p>'
				  									+ '<small>' + askingpriceObj.createDate + '</small>'
				  									+ '</div>'
				  									+ '<div style="width:20%;float:right">'
				  									+ '<p">'+ askingPriceStatus + '</p>'
				  									+ '<span class="glyphicon glyphicon-chevron-right"></span>'
				  									+ '</div>'
				  									+ '</a>'
				  									+ '</div>'
				
				wholeHtml += askingpriceHtml;
			});
			
			$("#aksingprice").append(wholeHtml);
		}
	});
})
